﻿<Window x:Class="LicenceKeyGenerator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:LicenceKeyGenerator"
        xmlns:ac="clr-namespace:AdornedControl;assembly=AdornedControl"
        Icon="encrypted.ico"
        Title="License Generator" Height="350" Width="525">
    <Window.Resources>
        <Style TargetType="TextBlock">
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>
    </Window.Resources>
    <TabControl >
        <TabItem>
            <TabItem.Header>
                <StackPanel Orientation="Horizontal">
                    <Image Source="random.ico" Height="16" RenderOptions.BitmapScalingMode="HighQuality"/>
                    <TextBlock Foreground="Black">Random</TextBlock>
                </StackPanel>
            </TabItem.Header>
            <Grid>
               
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.35*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Margin="5" HorizontalAlignment="Right">Number Of Key:</TextBlock>
                <TextBox x:Name="txtNumber" Width="100" Grid.Column="1" HorizontalAlignment="Left" Margin="5">100</TextBox>
                <TextBlock Margin="5" HorizontalAlignment="Right" Grid.Row="1">Key Length:</TextBlock>
                <Button Grid.Row="2"  Margin="5" Grid.ColumnSpan="2" Width="100" Height="22" FontWeight="Bold" Click="RandomStart">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="start.ico" Height="16" RenderOptions.BitmapScalingMode="HighQuality"/>
                        <TextBlock>Start</TextBlock>
                    </StackPanel>
                </Button>
                <ComboBox x:Name="cmbNumber" Grid.Row="1" Grid.Column="1" Width="50" HorizontalAlignment="Left" Margin="5" SelectedIndex="0">
                    <ComboBoxItem>16</ComboBoxItem>
                    <ComboBoxItem>20</ComboBoxItem>
                    <ComboBoxItem>24</ComboBoxItem>
                    <ComboBoxItem>28</ComboBoxItem>
                    <ComboBoxItem>32</ComboBoxItem>
                </ComboBox>
                <ac:AdornedControl Name="LoadingAdorner" IsAdornerVisible="{Binding IsBusy}" Grid.Row="3" Grid.ColumnSpan="2">
                    <ac:AdornedControl.AdornerContent>
                        <local:LoadingWait></local:LoadingWait>
                    </ac:AdornedControl.AdornerContent>
                    <DockPanel LastChildFill="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                        <StackPanel DockPanel.Dock="Top">
                            <Button Width="120" Height="22" HorizontalAlignment="Left" Margin="3" Click="RandomCopyToClipboard">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="copy.ico" Height="16" RenderOptions.BitmapScalingMode="HighQuality"/>
                                    <TextBlock>Copy to Clipboard</TextBlock>
                                </StackPanel>
                            </Button>
                        </StackPanel>
                        <ProgressBar  DockPanel.Dock="Bottom" Height="22" Value="{Binding RandomProgress}"></ProgressBar>
                        <ListBox Background="White" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="listBoxRandom" ItemsSource="{Binding Keys}">
                            
                        </ListBox>
                    </DockPanel>
                </ac:AdornedControl> 
               
            </Grid>
        </TabItem>
    </TabControl>
</Window>
